package com.ccrfid.rmc6.entity.business.patrol;

import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.*;
import java.sql.Time;

@Entity
@Table(name = "patrol_time_range")
public class PatrolTimeRangeEntity {
    private Long id;
    private String timeRangeName;
    private Integer timeRangeType;
    private Time startTime;
    private Time stopTime;

    @Id
    @Column(name = "id", nullable = false)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "time_range_name", length = 45)
    public String getTimeRangeName() {
        return timeRangeName;
    }

    public void setTimeRangeName(String timeRangeName) {
        this.timeRangeName = timeRangeName;
    }

    @Basic
    @Column(name = "time_range_type", nullable = false)
    public Integer getTimeRangeType() {
        return timeRangeType;
    }

    public void setTimeRangeType(Integer timeRangeType) {
        this.timeRangeType = timeRangeType;
    }

    @Basic
    @Column(name = "start_time", nullable = false)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm:ss")
    public Time getStartTime() {
        return startTime;
    }

    public void setStartTime(Time startTime) {
        this.startTime = startTime;
    }

    @Basic
    @Column(name = "stop_time", nullable = false)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm:ss")
    public Time getStopTime() {
        return stopTime;
    }

    public void setStopTime(Time stopTime) {
        this.stopTime = stopTime;
    }
}
